package localhost.mb;

import java.text.NumberFormat;
import java.util.Date;

import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

import localhost.ejb.DaoOrcamento;
import localhost.view.MessageBean;
import localhost.view.PageTransitionBean;
import localhost.view.ViewConsultas;

@ManagedBean(name = "mbConsultas")
@SessionScoped
public class MbConsultas {

	@EJB
	DaoOrcamento daoOrca;

	private ViewConsultas tela = new ViewConsultas();
	PageTransitionBean pt = new PageTransitionBean();
	MessageBean mb = new MessageBean();
	MetodosComuns mc = new MetodosComuns();
	FacesContext fc = FacesContext.getCurrentInstance();

	Date dataAlteracao = new Date();
	NumberFormat formatoMoeda = NumberFormat.getCurrencyInstance();

	// ############################ MENSAGENS #############################

	public ViewConsultas getTela() {
		return tela;
	}

	public void setTela(ViewConsultas tela) {
		this.tela = tela;
	}

	public void msgRetornoGeral(String idComp, String msg) {
		mb.addMessageSemBundle(msg, idComp, FacesMessage.SEVERITY_WARN);
	}

}